﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using VISS.API.Commons;
using NCT.Framework;
using System.Collections.Generic;
using VISS.Web.Frontend;


public partial class modules_general_gifstore : System.Web.UI.Page
{
    IProperty _iProperty = StructureMapFactory.GetInstance<IProperty>();
    protected List<PropertyEnt> lstProperty;
    protected UserContext userContext;
    protected string CurrentUserKey;
    protected string userKey;
    protected int TotalRecord = 0;
    protected string DisplayRecord;
    protected string Paging;
    int maxPage = 0;
    int pageSize = 6;
    int page=1;
   
    protected void Page_Load(object sender, EventArgs e)
    {
        userContext = LoginFactory.GetCurrentUser();
        if (userContext != null)
        {
            CurrentUserKey = userContext.UserKey;
        }       

        int intTotal=0;
        page = ConvertUtils.ToInt(Request.QueryString["p"], 1);
        lstProperty = _iProperty.GetByCategoryIDPaging(ConvertUtils.ToShort(1), page, pageSize, out TotalRecord);
        userKey = ConvertUtils.ToString(Request.QueryString["key"]);
        string queryString = AppSettings.RootURL + "gifstore?u=" + userKey;
       
        Paging pager;
        if (TotalRecord <= AppSettings.SearchDisplayRecordLimit)
        {
            pager = new Paging(TotalRecord);
        }
        else
        {
            pager = new Paging(AppSettings.SearchDisplayRecordLimit);
        }
        pager.PerPage = pageSize;
        pager.QueryString = queryString;
        pager.Param = "p";
        pager.ShowMore = false;
        pager.LinkFormatTemplate = "<div class=\"page\">{0}</div>";
        pager.SelectedPageFormatTemplate = "<div class=\"page selected-page\">{0}</div>";

        Paging = pager.BuildPaging();
    }
}
